package com.opo5.logisticsmanagement.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.opo5.logisticsmanagement.Vo.NewVo;
import com.opo5.logisticsmanagement.Vo.StatisVo;
import com.opo5.logisticsmanagement.domain.Depot;
import com.opo5.logisticsmanagement.domain.Locator;
import com.opo5.logisticsmanagement.domain.Material;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface MaterialDao extends BaseMapper<Material> {

    Locator getAll(Integer id);

    /**
     * 分页多表条件查询
     * @param currentPage
     * @param pageSize
     * @param material
     * @return
     */
    List<Material> getPageByCondition(@Param("currentPage") Integer currentPage,@Param("pageSize") Integer pageSize,@Param("material") Material material);

    /**
     * 查询总记录数
     * @param material
     * @return
     */
    Integer getTotal(@Param("material") Material material);
//    Page<NewVo> newpro(Page<NewVo> iPage);
    @Select("SELECT material_name,material_number,material_unit\n" +
            "FROM tbs_material")
    Page<StatisVo> materials(Page<StatisVo> iPage);
}
